#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 2e7+5;

bool noprime[N];
int prime[N], pcnt;
void init() {
    for (int i=2; i<N; ++i) {
        if (!noprime[i]) {
            prime[pcnt++] = i;

        }
        for (int j=0; j<pcnt; ++j) {
            LL nextp = 1LL * i * prime[j];
            if (nextp >= N) break;
            noprime[nextp] = 1;
            if (i % prime[j] == 0) break;
        }
    }
}

int main() {
    int n;
    cin >> n;
    init();
    for (int a=4; a<N; ++a) {

        if (noprime[a] && noprime[a + n]) {
            printf("%d %d\n", a + n, a);
            break;
        }
    }


    return 0;
}